#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__author__ = "Administrator"
__name__="python_process_to_thread"
__date__="2016/8/8"
__time__="17:49"
"""
# 进程产生线程。
from multiprocessing import Pool
import threading
import os

def t_fun(i,n):
    print 'trhead:%s  -->%s' %(os.getpid(),n)

def f(x):
    info_list=[]
    for i in range(5):
        t = threading.Thread(target=t_fun,args=[info_list,i])
        t.start()

pool = Pool(processes=5)
res_list = []

for i in range(10):
    res = pool.apply_async(f,[i,])
    print '----:',i
    res_list.append(res)
for r in res_list:
    print r.get(timeout=1)

